/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package isd.ventas.modelo;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author ctrosch
 */
@Entity
@Table(name="VTTCPI")
public class VT_PlanDePago implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    private VT_PlanDePagoPK id;

    @JoinColumn(name = "VTTCPI_CNDPAG", referencedColumnName = "VTTCPH_CNDPAG", nullable = false, insertable=false, updatable=false)
    @ManyToOne(optional = false)
    private VT_CondicionDePago condicionDePago;
    @Column(name = "VTTCPI_CUOTAS", nullable = false, scale=10)
    private int cuotas;
    @Column(name="VTTCPI_DIAPAG")
    private int diapag;
    @Column(name="VTTCPI_PORCEN", scale=10, precision=2)
    private BigDecimal porcen;
    @Column(name="VTTCPI_DIAFIJ")
    private int diafij;

    public VT_PlanDePagoPK getId() {
        return id;
    }

    public void setId(VT_PlanDePagoPK id) {
        this.id = id;
    }

    public VT_CondicionDePago getCondicionDePago() {
        return condicionDePago;
    }

    public void setCondicionDePago(VT_CondicionDePago condicionDePago) {
        this.condicionDePago = condicionDePago;
    }

    public int getCuotas() {
        return cuotas;
    }

    public void setCuotas(int cuotas) {
        this.cuotas = cuotas;
    }

    public int getDiafij() {
        return diafij;
    }

    public void setDiafij(int diafij) {
        this.diafij = diafij;
    }

    public int getDiapag() {
        return diapag;
    }

    public void setDiapag(int diapag) {
        this.diapag = diapag;
    }

    public BigDecimal getPorcen() {
        return porcen;
    }

    public void setPorcen(BigDecimal porcen) {
        this.porcen = porcen;
    }

    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof VT_PlanDePago)) {
            return false;
        }
        VT_PlanDePago other = (VT_PlanDePago) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "tv.venta.modelo.CuotaCondicionDePago[id=" + id + "]";
    }

}
